<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>title</title>
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <link rel="stylesheet" href="../css/base.css">

</head>
<body>
  <div class="wrap">
    <!-- 游戏 -->
    <div class="game-page">

      <!-- 视频列表 -->
    <div class="v-list-wrap" id="liveList">
      <ul class="clearfix" id="div_list">

      </ul>
    </div>
    <!-- 视频列表 end-->

    </div>
    <!-- 游戏 end-->
  </div>
</body>
<script type="text/x-dot-template" id="template">
{{~ it.msg : value : index }}
    <li >
      <div class="video-mask-box">
      <a href="{{= value. url }}"><img src="{{= value. img }}" alt="" class="game-pic"></a>
      </div>
      <div class="til">{{= value. title }}</div>

    </li>
{{~}}
</script>
<script type="text/javascript" src="../script/api.js" ></script>
<script type="text/javascript" src="../script/doT.js"></script>
<script type="text/javascript">

  apiready = function(){
    api.showProgress({
        title: '加载中...',
        modal: false
    });
    var div_list = $api.byId('div_list');
    var template = $api.byId('template');
    api.ajax({
        url: 'http://video.jikue.com/login/login/zhibozb.html',
        method: 'get'
    },function(ret, err){
        if (ret) {
          //alert( JSON.stringify( ret ) );
          var pagefn = doT.template(template.text);
          div_list.innerHTML = pagefn(ret);
          api.hideProgress();
        } else {
          api.hideProgress();
            //alert( JSON.stringify( err ) );
        }
    });

  }

  function getList(){

  }


  function openFrame(name){
        var delay = 0;
        if(api.systemType != 'ios'){
            delay = 300;
        }
        api.openWin({
            name: 'vplay_win',
            url: './h5.html',
            bounces:false,
            delay: delay,
            slidBackEnabled:true,
            vScrollBarEnabled:false,
            pageParam:{id:name}
        });
    }


  function openWin11(name){
    var time = localStorage.getItem('user_time');
    var user_id = localStorage.getItem('user_id');
    var username = localStorage.getItem('user_name');
    var timestamp = Date.parse(new Date())/1000;
    if(user_id==0){
      api.alert({
          title: '温馨提示',
          msg: '请先登陆后使用',
      });
      api.openWin({
          name: 'login',
          url: 'login.html',
          delay: 300
      });
      return;

    }

    if (time>timestamp) {

      var delay = 0;
      if(api.systemType != 'ios'){
          delay = 300;
      }
      api.openWin({
          name: 'vplay_win',
          url: 'vplay_win.html',
          bounces:false,
          delay: delay,
          slidBackEnabled:true,
          vScrollBarEnabled:false,
          pageParam:{video:name}
      });


    }else if (time<timestamp){
      var dialogBox = api.require('dialogBox');
      dialogBox.alert({
          texts: {
              content: '您的VIP会员已过期，请及时续费！',
              leftBtnTitle: '在想想',
              rightBtnTitle: '去开通'
          },
          styles: {
              bg: '#fff',
              w: 300,
              content: {
                  color: '#000',
                  size: 14
              },
              left: {
                  marginB: 7,
                  marginL: 20,
                  w: 130,
                  h: 35,
                  corner: 2,
                  bg: '#ff7600',
                  color: '#fff',
                  size: 14
              },
              right: {
                  marginB: 7,
                  marginL: 10,
                  w: 130,
                  h: 35,
                  corner: 2,
                  bg: '#ff7600',
                  color: '#fff',
                  size: 14
              }
          }
      }, function(ret) {
          if (ret.eventType == 'left') {
              var dialogBox = api.require('dialogBox');
              dialogBox.close({
                  dialogName: 'alert'
              });
          }else if (ret.eventType == 'right') {
            api.openWin({
                name: 'open_vip_win',
                url: './open_vip_win.html',
                delay: 300
            });
            var dialogBox = api.require('dialogBox');
            dialogBox.close({
                dialogName: 'alert'
            });
          }
      });
    }

  }


</script>
</html>
